<?php
namespace Home\Controller;

class BaseController extends \Think\Controller
{
    protected  function checkLogin()
    {
        $userInfo = session('userInfo');
        // 判断登录状态
        if(!isset($userInfo['id']) || empty($userInfo['id'])) {
            $this->error('请登录后操作', U('Login/index'));
        } else {
            return $userInfo;
        }
    }
}